Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Implement an array sorting script #116

Merged
merged 11 commits into from
Jan 26, 2025

Conversation

martinvibes
Copy link
Contributor

πŸ“ Pull Request Title

[FEAT]: Implement Sorting Algorithms

πŸ› οΈ Issue

Closes #105

πŸ“– Description

This PR implements sorting algorithms to provide efficient array sorting capabilities. The implementation includes:

Created interface.cairo defining Sortable and SortableVec traits for consistent sorting interfaces
Implemented QuickSort algorithm with optimized pivot selection
Added Alexandria data structures as a dependency for vector operations
Structured the code in a modular way with separate files for interface and implementation
Fixed compilation issues and imports
Added proper error handling for edge cases (empty arrays, single elements)

πŸ–ΌοΈ Screenshots

N/A - Implementation is code-only
πŸ“ Additional Notes

The implementation supports both array and vector-based sorting
The code is prepared for future additions of other sorting algorithms
Tested with various input sizes and types
All files include proper documentation and type annotations

@martinvibes
Copy link
Contributor Author

hey @coxmars kindly review :)

@danielcdz danielcdz added the ODBoost This issue will be available ONLY during the ODBoost label Jan 24, 2025
@coxmars
Copy link
Contributor

coxmars commented Jan 25, 2025

Hi @martinvibes, can you add a .tool-versions file with the Scarb and Starknet foundry versions you are using?

@martinvibes
Copy link
Contributor Author

@coxmars i have added it sir

Copy link
Contributor

@coxmars coxmars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add small tests for each sorting (2 edge cases at least) to validate that they all work correctly and add a screenshot.

@martinvibes
Copy link
Contributor Author

martinvibes commented Jan 25, 2025

Alright sir on it

@martinvibes
Copy link
Contributor Author

hello @coxmars i have written tests for them and all tests are passing :)
image

@martinvibes martinvibes requested a review from coxmars January 25, 2025 16:25
Copy link
Contributor

@coxmars coxmars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local verification done, all good. Ready for second review. @danielcdz 🎯

@martinvibes
Copy link
Contributor Author

hello @danielcdz i have implemented required change πŸ‘
Everything looks Good now :)

@martinvibes martinvibes requested a review from danielcdz January 26, 2025 06:40
Copy link
Member

@danielcdz danielcdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danielcdz danielcdz merged commit 7b46a6b into KaizeNodeLabs:main Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ODBoost This issue will be available ONLY during the ODBoost
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT]: Implement an array sorting script
3 participants